<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Api extends CI_Controller
{
    
    public function __construct() {
        
    }
    
    function getsListPhone()
    {	
        // Post value
        $_token          = $_POST['API_TOKEN'];
        $_signature      = $_POST['Signature'];
        
        if($_token != API_TOKEN){
            echo -110;return; //sai serect key
        }

        if($_signature != md5(API_TOKEN)){
            echo -111;return; //sai chu ki
        }
        
        $options = array(
            'http' => array(
                    'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 
                    //'content' => http_build_query($_data) 
            ) 
        );
        $context    = stream_context_create($options);
        $result     = file_get_contents(EV_API_URL, false, $context);

        if($result){
            echo $result;return;
        }else{
            echo -112;return;
        }
    }
}